Left Termination of the query pattern s2_in_2(g, a) w.r.t. the given Prolog program could not be shown:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

s2(plus(A, plus(B, C)), D) :- s2(plus(plus(A, B), C), D).
s2(plus(A, B), C) :- s2(plus(B, A), C).
s2(plus(X, 0), X).
s2(plus(X, Y), Z) :- ','(s2(X, A), ','(s2(Y, B), s2(plus(A, B), Z))).
s2(plus(A, B), C) :- ','(isNat(A), ','(isNat(B), add(A, B, C))).
isNat(s(X)) :- isNat(X).
isNat(0).
add(s(X), Y, s(Z)) :- add(X, Y, Z).
add(0, X, X).

Queries:

s2(g,a).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
s2_in: (b,f)
isNat_in: (b)
add_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, plus(B, C)), D) → U1_GA(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
S2_IN_GA(plus(A, plus(B, C)), D) → S2_IN_GA(plus(plus(A, B), C), D)
S2_IN_GA(plus(A, B), C) → U2_GA(A, B, C, s2_in_ga(plus(B, A), C))
S2_IN_GA(plus(A, B), C) → S2_IN_GA(plus(B, A), C)
S2_IN_GA(plus(X, Y), Z) → U3_GA(X, Y, Z, s2_in_ga(X, A))
S2_IN_GA(plus(X, Y), Z) → S2_IN_GA(X, A)
S2_IN_GA(plus(A, B), C) → U6_GA(A, B, C, isNat_in_g(A))
S2_IN_GA(plus(A, B), C) → ISNAT_IN_G(A)
ISNAT_IN_G(s(X)) → U9_G(X, isNat_in_g(X))
ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)
U6_GA(A, B, C, isNat_out_g(A)) → U7_GA(A, B, C, isNat_in_g(B))
U6_GA(A, B, C, isNat_out_g(A)) → ISNAT_IN_G(B)
U7_GA(A, B, C, isNat_out_g(B)) → U8_GA(A, B, C, add_in_gga(A, B, C))
U7_GA(A, B, C, isNat_out_g(B)) → ADD_IN_GGA(A, B, C)
ADD_IN_GGA(s(X), Y, s(Z)) → U10_GGA(X, Y, Z, add_in_gga(X, Y, Z))
ADD_IN_GGA(s(X), Y, s(Z)) → ADD_IN_GGA(X, Y, Z)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → U4_GA(X, Y, Z, A, s2_in_ga(Y, B))
U3_GA(X, Y, Z, s2_out_ga(X, A)) → S2_IN_GA(Y, B)
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → U5_GA(X, Y, Z, s2_in_ga(plus(A, B), Z))
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B), Z)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
U6_GA(x1, x2, x3, x4)  =  U6_GA(x1, x2, x4)
U10_GGA(x1, x2, x3, x4)  =  U10_GGA(x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x4, x5)
S2_IN_GA(x1, x2)  =  S2_IN_GA(x1)
ISNAT_IN_G(x1)  =  ISNAT_IN_G(x1)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x2, x4)
U8_GA(x1, x2, x3, x4)  =  U8_GA(x4)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)
U5_GA(x1, x2, x3, x4)  =  U5_GA(x4)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x5)
U9_G(x1, x2)  =  U9_G(x2)
U7_GA(x1, x2, x3, x4)  =  U7_GA(x1, x2, x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, plus(B, C)), D) → U1_GA(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
S2_IN_GA(plus(A, plus(B, C)), D) → S2_IN_GA(plus(plus(A, B), C), D)
S2_IN_GA(plus(A, B), C) → U2_GA(A, B, C, s2_in_ga(plus(B, A), C))
S2_IN_GA(plus(A, B), C) → S2_IN_GA(plus(B, A), C)
S2_IN_GA(plus(X, Y), Z) → U3_GA(X, Y, Z, s2_in_ga(X, A))
S2_IN_GA(plus(X, Y), Z) → S2_IN_GA(X, A)
S2_IN_GA(plus(A, B), C) → U6_GA(A, B, C, isNat_in_g(A))
S2_IN_GA(plus(A, B), C) → ISNAT_IN_G(A)
ISNAT_IN_G(s(X)) → U9_G(X, isNat_in_g(X))
ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)
U6_GA(A, B, C, isNat_out_g(A)) → U7_GA(A, B, C, isNat_in_g(B))
U6_GA(A, B, C, isNat_out_g(A)) → ISNAT_IN_G(B)
U7_GA(A, B, C, isNat_out_g(B)) → U8_GA(A, B, C, add_in_gga(A, B, C))
U7_GA(A, B, C, isNat_out_g(B)) → ADD_IN_GGA(A, B, C)
ADD_IN_GGA(s(X), Y, s(Z)) → U10_GGA(X, Y, Z, add_in_gga(X, Y, Z))
ADD_IN_GGA(s(X), Y, s(Z)) → ADD_IN_GGA(X, Y, Z)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → U4_GA(X, Y, Z, A, s2_in_ga(Y, B))
U3_GA(X, Y, Z, s2_out_ga(X, A)) → S2_IN_GA(Y, B)
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → U5_GA(X, Y, Z, s2_in_ga(plus(A, B), Z))
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B), Z)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
U6_GA(x1, x2, x3, x4)  =  U6_GA(x1, x2, x4)
U10_GGA(x1, x2, x3, x4)  =  U10_GGA(x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x4, x5)
S2_IN_GA(x1, x2)  =  S2_IN_GA(x1)
ISNAT_IN_G(x1)  =  ISNAT_IN_G(x1)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x2, x4)
U8_GA(x1, x2, x3, x4)  =  U8_GA(x4)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)
U5_GA(x1, x2, x3, x4)  =  U5_GA(x4)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x5)
U9_G(x1, x2)  =  U9_G(x2)
U7_GA(x1, x2, x3, x4)  =  U7_GA(x1, x2, x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 11 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

ADD_IN_GGA(s(X), Y, s(Z)) → ADD_IN_GGA(X, Y, Z)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

ADD_IN_GGA(s(X), Y, s(Z)) → ADD_IN_GGA(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

ADD_IN_GGA(s(X), Y) → ADD_IN_GGA(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
ISNAT_IN_G(x1)  =  ISNAT_IN_G(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, plus(B, C)), D) → S2_IN_GA(plus(plus(A, B), C), D)
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B), Z)
S2_IN_GA(plus(A, B), C) → S2_IN_GA(plus(B, A), C)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → S2_IN_GA(Y, B)
S2_IN_GA(plus(X, Y), Z) → S2_IN_GA(X, A)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → U4_GA(X, Y, Z, A, s2_in_ga(Y, B))
S2_IN_GA(plus(X, Y), Z) → U3_GA(X, Y, Z, s2_in_ga(X, A))

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x2)
isNat_out_g(x1)  =  isNat_out_g
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x4, x5)
S2_IN_GA(x1, x2)  =  S2_IN_GA(x1)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x2, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ QDPOrderProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(X, Y)) → U3_GA(Y, s2_in_ga(X))
U3_GA(Y, s2_out_ga(A)) → U4_GA(A, s2_in_ga(Y))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
U4_GA(A, s2_out_ga(B)) → S2_IN_GA(plus(A, B))
U3_GA(Y, s2_out_ga(A)) → S2_IN_GA(Y)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(X)
s2_in_ga(plus(X, Y)) → U3_ga(Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(isNat_in_g(X))
isNat_in_g(0) → isNat_out_g
U9_g(isNat_out_g) → isNat_out_g
U6_ga(A, B, isNat_out_g) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g) → U8_ga(add_in_gga(A, B))
add_in_gga(s(X), Y) → U10_gga(add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(X)
U10_gga(add_out_gga(Z)) → add_out_gga(s(Z))
U8_ga(add_out_gga(C)) → s2_out_ga(C)
U3_ga(Y, s2_out_ga(A)) → U4_ga(A, s2_in_ga(Y))
U4_ga(A, s2_out_ga(B)) → U5_ga(s2_in_ga(plus(A, B)))
U5_ga(s2_out_ga(Z)) → s2_out_ga(Z)
U2_ga(s2_out_ga(C)) → s2_out_ga(C)
U1_ga(s2_out_ga(D)) → s2_out_ga(D)

The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0)
U8_ga(x0)
U3_ga(x0, x1)
U4_ga(x0, x1)
U5_ga(x0)
U2_ga(x0)
U1_ga(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


S2_IN_GA(plus(X, Y)) → U3_GA(Y, s2_in_ga(X))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)
The remaining pairs can at least be oriented weakly.

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
U3_GA(Y, s2_out_ga(A)) → U4_GA(A, s2_in_ga(Y))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
U4_GA(A, s2_out_ga(B)) → S2_IN_GA(plus(A, B))
U3_GA(Y, s2_out_ga(A)) → S2_IN_GA(Y)
Used ordering: Polynomial interpretation [25]:

POL(0) = 1   
POL(S2_IN_GA(x1)) = 1 + x1   
POL(U10_gga(x1)) = 1 + x1   
POL(U1_ga(x1)) = x1   
POL(U2_ga(x1)) = x1   
POL(U3_GA(x1, x2)) = x1 + x2   
POL(U3_ga(x1, x2)) = 1 + x1 + x2   
POL(U4_GA(x1, x2)) = 1 + x1 + x2   
POL(U4_ga(x1, x2)) = 1 + x1 + x2   
POL(U5_ga(x1)) = x1   
POL(U6_ga(x1, x2, x3)) = x1 + x2   
POL(U7_ga(x1, x2, x3)) = x1 + x2   
POL(U8_ga(x1)) = x1   
POL(U9_g(x1)) = 0   
POL(add_in_gga(x1, x2)) = x1 + x2   
POL(add_out_gga(x1)) = 1 + x1   
POL(isNat_in_g(x1)) = x1   
POL(isNat_out_g) = 0   
POL(plus(x1, x2)) = 1 + x1 + x2   
POL(s(x1)) = 1 + x1   
POL(s2_in_ga(x1)) = x1   
POL(s2_out_ga(x1)) = 1 + x1   

The following usable rules [17] were oriented:

add_in_gga(s(X), Y) → U10_gga(add_in_gga(X, Y))
s2_in_ga(plus(A, plus(B, C))) → U1_ga(s2_in_ga(plus(plus(A, B), C)))
U2_ga(s2_out_ga(C)) → s2_out_ga(C)
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
U7_ga(A, B, isNat_out_g) → U8_ga(add_in_gga(A, B))
U3_ga(Y, s2_out_ga(A)) → U4_ga(A, s2_in_ga(Y))
U8_ga(add_out_gga(C)) → s2_out_ga(C)
U1_ga(s2_out_ga(D)) → s2_out_ga(D)
s2_in_ga(plus(A, B)) → U2_ga(s2_in_ga(plus(B, A)))
U6_ga(A, B, isNat_out_g) → U7_ga(A, B, isNat_in_g(B))
U4_ga(A, s2_out_ga(B)) → U5_ga(s2_in_ga(plus(A, B)))
s2_in_ga(plus(X, 0)) → s2_out_ga(X)
U10_gga(add_out_gga(Z)) → add_out_gga(s(Z))
U5_ga(s2_out_ga(Z)) → s2_out_ga(Z)
s2_in_ga(plus(X, Y)) → U3_ga(Y, s2_in_ga(X))
add_in_gga(0, X) → add_out_gga(X)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
U3_GA(Y, s2_out_ga(A)) → U4_GA(A, s2_in_ga(Y))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
U4_GA(A, s2_out_ga(B)) → S2_IN_GA(plus(A, B))
U3_GA(Y, s2_out_ga(A)) → S2_IN_GA(Y)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(X)
s2_in_ga(plus(X, Y)) → U3_ga(Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(isNat_in_g(X))
isNat_in_g(0) → isNat_out_g
U9_g(isNat_out_g) → isNat_out_g
U6_ga(A, B, isNat_out_g) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g) → U8_ga(add_in_gga(A, B))
add_in_gga(s(X), Y) → U10_gga(add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(X)
U10_gga(add_out_gga(Z)) → add_out_gga(s(Z))
U8_ga(add_out_gga(C)) → s2_out_ga(C)
U3_ga(Y, s2_out_ga(A)) → U4_ga(A, s2_in_ga(Y))
U4_ga(A, s2_out_ga(B)) → U5_ga(s2_in_ga(plus(A, B)))
U5_ga(s2_out_ga(Z)) → s2_out_ga(Z)
U2_ga(s2_out_ga(C)) → s2_out_ga(C)
U1_ga(s2_out_ga(D)) → s2_out_ga(D)

The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0)
U8_ga(x0)
U3_ga(x0, x1)
U4_ga(x0, x1)
U5_ga(x0)
U2_ga(x0)
U1_ga(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 3 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ DependencyGraphProof
QDP
                            ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(X)
s2_in_ga(plus(X, Y)) → U3_ga(Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(isNat_in_g(X))
isNat_in_g(0) → isNat_out_g
U9_g(isNat_out_g) → isNat_out_g
U6_ga(A, B, isNat_out_g) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g) → U8_ga(add_in_gga(A, B))
add_in_gga(s(X), Y) → U10_gga(add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(X)
U10_gga(add_out_gga(Z)) → add_out_gga(s(Z))
U8_ga(add_out_gga(C)) → s2_out_ga(C)
U3_ga(Y, s2_out_ga(A)) → U4_ga(A, s2_in_ga(Y))
U4_ga(A, s2_out_ga(B)) → U5_ga(s2_in_ga(plus(A, B)))
U5_ga(s2_out_ga(Z)) → s2_out_ga(Z)
U2_ga(s2_out_ga(C)) → s2_out_ga(C)
U1_ga(s2_out_ga(D)) → s2_out_ga(D)

The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0)
U8_ga(x0)
U3_ga(x0, x1)
U4_ga(x0, x1)
U5_ga(x0)
U2_ga(x0)
U1_ga(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ DependencyGraphProof
                          ↳ QDP
                            ↳ UsableRulesProof
QDP
                                ↳ QReductionProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))

R is empty.
The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0)
U8_ga(x0)
U3_ga(x0, x1)
U4_ga(x0, x1)
U5_ga(x0)
U2_ga(x0)
U1_ga(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0)
U8_ga(x0)
U3_ga(x0, x1)
U4_ga(x0, x1)
U5_ga(x0)
U2_ga(x0)
U1_ga(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ DependencyGraphProof
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
QDP
                                    ↳ NonTerminationProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))

The TRS R consists of the following rules:none


s = S2_IN_GA(plus(A, B)) evaluates to t =S2_IN_GA(plus(B, A))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from S2_IN_GA(plus(A, B)) to S2_IN_GA(plus(B, A)).




We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
s2_in: (b,f)
isNat_in: (b)
add_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, plus(B, C)), D) → U1_GA(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
S2_IN_GA(plus(A, plus(B, C)), D) → S2_IN_GA(plus(plus(A, B), C), D)
S2_IN_GA(plus(A, B), C) → U2_GA(A, B, C, s2_in_ga(plus(B, A), C))
S2_IN_GA(plus(A, B), C) → S2_IN_GA(plus(B, A), C)
S2_IN_GA(plus(X, Y), Z) → U3_GA(X, Y, Z, s2_in_ga(X, A))
S2_IN_GA(plus(X, Y), Z) → S2_IN_GA(X, A)
S2_IN_GA(plus(A, B), C) → U6_GA(A, B, C, isNat_in_g(A))
S2_IN_GA(plus(A, B), C) → ISNAT_IN_G(A)
ISNAT_IN_G(s(X)) → U9_G(X, isNat_in_g(X))
ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)
U6_GA(A, B, C, isNat_out_g(A)) → U7_GA(A, B, C, isNat_in_g(B))
U6_GA(A, B, C, isNat_out_g(A)) → ISNAT_IN_G(B)
U7_GA(A, B, C, isNat_out_g(B)) → U8_GA(A, B, C, add_in_gga(A, B, C))
U7_GA(A, B, C, isNat_out_g(B)) → ADD_IN_GGA(A, B, C)
ADD_IN_GGA(s(X), Y, s(Z)) → U10_GGA(X, Y, Z, add_in_gga(X, Y, Z))
ADD_IN_GGA(s(X), Y, s(Z)) → ADD_IN_GGA(X, Y, Z)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → U4_GA(X, Y, Z, A, s2_in_ga(Y, B))
U3_GA(X, Y, Z, s2_out_ga(X, A)) → S2_IN_GA(Y, B)
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → U5_GA(X, Y, Z, s2_in_ga(plus(A, B), Z))
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B), Z)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)
U6_GA(x1, x2, x3, x4)  =  U6_GA(x1, x2, x4)
U10_GGA(x1, x2, x3, x4)  =  U10_GGA(x1, x2, x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x4, x5)
S2_IN_GA(x1, x2)  =  S2_IN_GA(x1)
ISNAT_IN_G(x1)  =  ISNAT_IN_G(x1)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x1, x2, x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x2, x4)
U8_GA(x1, x2, x3, x4)  =  U8_GA(x1, x2, x4)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)
U5_GA(x1, x2, x3, x4)  =  U5_GA(x1, x2, x4)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
U9_G(x1, x2)  =  U9_G(x1, x2)
U7_GA(x1, x2, x3, x4)  =  U7_GA(x1, x2, x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, plus(B, C)), D) → U1_GA(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
S2_IN_GA(plus(A, plus(B, C)), D) → S2_IN_GA(plus(plus(A, B), C), D)
S2_IN_GA(plus(A, B), C) → U2_GA(A, B, C, s2_in_ga(plus(B, A), C))
S2_IN_GA(plus(A, B), C) → S2_IN_GA(plus(B, A), C)
S2_IN_GA(plus(X, Y), Z) → U3_GA(X, Y, Z, s2_in_ga(X, A))
S2_IN_GA(plus(X, Y), Z) → S2_IN_GA(X, A)
S2_IN_GA(plus(A, B), C) → U6_GA(A, B, C, isNat_in_g(A))
S2_IN_GA(plus(A, B), C) → ISNAT_IN_G(A)
ISNAT_IN_G(s(X)) → U9_G(X, isNat_in_g(X))
ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)
U6_GA(A, B, C, isNat_out_g(A)) → U7_GA(A, B, C, isNat_in_g(B))
U6_GA(A, B, C, isNat_out_g(A)) → ISNAT_IN_G(B)
U7_GA(A, B, C, isNat_out_g(B)) → U8_GA(A, B, C, add_in_gga(A, B, C))
U7_GA(A, B, C, isNat_out_g(B)) → ADD_IN_GGA(A, B, C)
ADD_IN_GGA(s(X), Y, s(Z)) → U10_GGA(X, Y, Z, add_in_gga(X, Y, Z))
ADD_IN_GGA(s(X), Y, s(Z)) → ADD_IN_GGA(X, Y, Z)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → U4_GA(X, Y, Z, A, s2_in_ga(Y, B))
U3_GA(X, Y, Z, s2_out_ga(X, A)) → S2_IN_GA(Y, B)
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → U5_GA(X, Y, Z, s2_in_ga(plus(A, B), Z))
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B), Z)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)
U6_GA(x1, x2, x3, x4)  =  U6_GA(x1, x2, x4)
U10_GGA(x1, x2, x3, x4)  =  U10_GGA(x1, x2, x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x4, x5)
S2_IN_GA(x1, x2)  =  S2_IN_GA(x1)
ISNAT_IN_G(x1)  =  ISNAT_IN_G(x1)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x1, x2, x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x2, x4)
U8_GA(x1, x2, x3, x4)  =  U8_GA(x1, x2, x4)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)
U5_GA(x1, x2, x3, x4)  =  U5_GA(x1, x2, x4)
U1_GA(x1, x2, x3, x4, x5)  =  U1_GA(x1, x2, x3, x5)
U9_G(x1, x2)  =  U9_G(x1, x2)
U7_GA(x1, x2, x3, x4)  =  U7_GA(x1, x2, x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 11 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

ADD_IN_GGA(s(X), Y, s(Z)) → ADD_IN_GGA(X, Y, Z)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

ADD_IN_GGA(s(X), Y, s(Z)) → ADD_IN_GGA(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
ADD_IN_GGA(x1, x2, x3)  =  ADD_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

ADD_IN_GGA(s(X), Y) → ADD_IN_GGA(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)
ISNAT_IN_G(x1)  =  ISNAT_IN_G(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

ISNAT_IN_G(s(X)) → ISNAT_IN_G(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, plus(B, C)), D) → S2_IN_GA(plus(plus(A, B), C), D)
U4_GA(X, Y, Z, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B), Z)
S2_IN_GA(plus(A, B), C) → S2_IN_GA(plus(B, A), C)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → S2_IN_GA(Y, B)
S2_IN_GA(plus(X, Y), Z) → S2_IN_GA(X, A)
U3_GA(X, Y, Z, s2_out_ga(X, A)) → U4_GA(X, Y, Z, A, s2_in_ga(Y, B))
S2_IN_GA(plus(X, Y), Z) → U3_GA(X, Y, Z, s2_in_ga(X, A))

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C)), D) → U1_ga(A, B, C, D, s2_in_ga(plus(plus(A, B), C), D))
s2_in_ga(plus(A, B), C) → U2_ga(A, B, C, s2_in_ga(plus(B, A), C))
s2_in_ga(plus(X, 0), X) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y), Z) → U3_ga(X, Y, Z, s2_in_ga(X, A))
s2_in_ga(plus(A, B), C) → U6_ga(A, B, C, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, C, isNat_out_g(A)) → U7_ga(A, B, C, isNat_in_g(B))
U7_ga(A, B, C, isNat_out_g(B)) → U8_ga(A, B, C, add_in_gga(A, B, C))
add_in_gga(s(X), Y, s(Z)) → U10_gga(X, Y, Z, add_in_gga(X, Y, Z))
add_in_gga(0, X, X) → add_out_gga(0, X, X)
U10_gga(X, Y, Z, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, C, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, Z, s2_out_ga(X, A)) → U4_ga(X, Y, Z, A, s2_in_ga(Y, B))
U4_ga(X, Y, Z, A, s2_out_ga(Y, B)) → U5_ga(X, Y, Z, s2_in_ga(plus(A, B), Z))
U5_ga(X, Y, Z, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, C, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, D, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The argument filtering Pi contains the following mapping:
s2_in_ga(x1, x2)  =  s2_in_ga(x1)
plus(x1, x2)  =  plus(x1, x2)
U1_ga(x1, x2, x3, x4, x5)  =  U1_ga(x1, x2, x3, x5)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x1, x2, x4)
0  =  0
s2_out_ga(x1, x2)  =  s2_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x2, x4)
U6_ga(x1, x2, x3, x4)  =  U6_ga(x1, x2, x4)
isNat_in_g(x1)  =  isNat_in_g(x1)
s(x1)  =  s(x1)
U9_g(x1, x2)  =  U9_g(x1, x2)
isNat_out_g(x1)  =  isNat_out_g(x1)
U7_ga(x1, x2, x3, x4)  =  U7_ga(x1, x2, x4)
U8_ga(x1, x2, x3, x4)  =  U8_ga(x1, x2, x4)
add_in_gga(x1, x2, x3)  =  add_in_gga(x1, x2)
U10_gga(x1, x2, x3, x4)  =  U10_gga(x1, x2, x4)
add_out_gga(x1, x2, x3)  =  add_out_gga(x1, x2, x3)
U4_ga(x1, x2, x3, x4, x5)  =  U4_ga(x1, x2, x4, x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x2, x4)
U4_GA(x1, x2, x3, x4, x5)  =  U4_GA(x1, x2, x4, x5)
S2_IN_GA(x1, x2)  =  S2_IN_GA(x1)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x2, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
U3_GA(X, Y, s2_out_ga(X, A)) → U4_GA(X, Y, A, s2_in_ga(Y))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)
U3_GA(X, Y, s2_out_ga(X, A)) → S2_IN_GA(Y)
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
S2_IN_GA(plus(X, Y)) → U3_GA(X, Y, s2_in_ga(X))
U4_GA(X, Y, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B))

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(A, B, C, s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(A, B, s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y)) → U3_ga(X, Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, isNat_out_g(A)) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g(B)) → U8_ga(A, B, add_in_gga(A, B))
add_in_gga(s(X), Y) → U10_gga(X, Y, add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(0, X, X)
U10_gga(X, Y, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, s2_out_ga(X, A)) → U4_ga(X, Y, A, s2_in_ga(Y))
U4_ga(X, Y, A, s2_out_ga(Y, B)) → U5_ga(X, Y, s2_in_ga(plus(A, B)))
U5_ga(X, Y, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0, x1)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U8_ga(x0, x1, x2)
U3_ga(x0, x1, x2)
U4_ga(x0, x1, x2, x3)
U5_ga(x0, x1, x2)
U2_ga(x0, x1, x2)
U1_ga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U3_GA(X, Y, s2_out_ga(X, A)) → U4_GA(X, Y, A, s2_in_ga(Y))
S2_IN_GA(plus(X, Y)) → S2_IN_GA(X)
U3_GA(X, Y, s2_out_ga(X, A)) → S2_IN_GA(Y)
S2_IN_GA(plus(X, Y)) → U3_GA(X, Y, s2_in_ga(X))
The remaining pairs can at least be oriented weakly.

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
U4_GA(X, Y, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B))
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(S2_IN_GA(x1)) = 1 + x1   
POL(U10_gga(x1, x2, x3)) = x2   
POL(U1_ga(x1, x2, x3, x4)) = x4   
POL(U2_ga(x1, x2, x3)) = x3   
POL(U3_GA(x1, x2, x3)) = 1 + x2 + x3   
POL(U3_ga(x1, x2, x3)) = x2 + x3   
POL(U4_GA(x1, x2, x3, x4)) = 1 + x3 + x4   
POL(U4_ga(x1, x2, x3, x4)) = 1 + x3 + x4   
POL(U5_ga(x1, x2, x3)) = x3   
POL(U6_ga(x1, x2, x3)) = 1 + x1 + x2   
POL(U7_ga(x1, x2, x3)) = 1 + x2   
POL(U8_ga(x1, x2, x3)) = 1 + x3   
POL(U9_g(x1, x2)) = 0   
POL(add_in_gga(x1, x2)) = x2   
POL(add_out_gga(x1, x2, x3)) = x3   
POL(isNat_in_g(x1)) = 0   
POL(isNat_out_g(x1)) = 0   
POL(plus(x1, x2)) = 1 + x1 + x2   
POL(s(x1)) = 0   
POL(s2_in_ga(x1)) = x1   
POL(s2_out_ga(x1, x2)) = 1 + x2   

The following usable rules [17] were oriented:

U8_ga(A, B, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)
U2_ga(A, B, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
s2_in_ga(plus(X, Y)) → U3_ga(X, Y, s2_in_ga(X))
U6_ga(A, B, isNat_out_g(A)) → U7_ga(A, B, isNat_in_g(B))
s2_in_ga(plus(A, plus(B, C))) → U1_ga(A, B, C, s2_in_ga(plus(plus(A, B), C)))
U10_gga(X, Y, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U5_ga(X, Y, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
U7_ga(A, B, isNat_out_g(B)) → U8_ga(A, B, add_in_gga(A, B))
add_in_gga(0, X) → add_out_gga(0, X, X)
s2_in_ga(plus(A, B)) → U2_ga(A, B, s2_in_ga(plus(B, A)))
U4_ga(X, Y, A, s2_out_ga(Y, B)) → U5_ga(X, Y, s2_in_ga(plus(A, B)))
add_in_gga(s(X), Y) → U10_gga(X, Y, add_in_gga(X, Y))
s2_in_ga(plus(X, 0)) → s2_out_ga(plus(X, 0), X)
U3_ga(X, Y, s2_out_ga(X, A)) → U4_ga(X, Y, A, s2_in_ga(Y))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))
U4_GA(X, Y, A, s2_out_ga(Y, B)) → S2_IN_GA(plus(A, B))

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(A, B, C, s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(A, B, s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y)) → U3_ga(X, Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, isNat_out_g(A)) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g(B)) → U8_ga(A, B, add_in_gga(A, B))
add_in_gga(s(X), Y) → U10_gga(X, Y, add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(0, X, X)
U10_gga(X, Y, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, s2_out_ga(X, A)) → U4_ga(X, Y, A, s2_in_ga(Y))
U4_ga(X, Y, A, s2_out_ga(Y, B)) → U5_ga(X, Y, s2_in_ga(plus(A, B)))
U5_ga(X, Y, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0, x1)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U8_ga(x0, x1, x2)
U3_ga(x0, x1, x2)
U4_ga(x0, x1, x2, x3)
U5_ga(x0, x1, x2)
U2_ga(x0, x1, x2)
U1_ga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ DependencyGraphProof
QDP
                            ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))

The TRS R consists of the following rules:

s2_in_ga(plus(A, plus(B, C))) → U1_ga(A, B, C, s2_in_ga(plus(plus(A, B), C)))
s2_in_ga(plus(A, B)) → U2_ga(A, B, s2_in_ga(plus(B, A)))
s2_in_ga(plus(X, 0)) → s2_out_ga(plus(X, 0), X)
s2_in_ga(plus(X, Y)) → U3_ga(X, Y, s2_in_ga(X))
s2_in_ga(plus(A, B)) → U6_ga(A, B, isNat_in_g(A))
isNat_in_g(s(X)) → U9_g(X, isNat_in_g(X))
isNat_in_g(0) → isNat_out_g(0)
U9_g(X, isNat_out_g(X)) → isNat_out_g(s(X))
U6_ga(A, B, isNat_out_g(A)) → U7_ga(A, B, isNat_in_g(B))
U7_ga(A, B, isNat_out_g(B)) → U8_ga(A, B, add_in_gga(A, B))
add_in_gga(s(X), Y) → U10_gga(X, Y, add_in_gga(X, Y))
add_in_gga(0, X) → add_out_gga(0, X, X)
U10_gga(X, Y, add_out_gga(X, Y, Z)) → add_out_gga(s(X), Y, s(Z))
U8_ga(A, B, add_out_gga(A, B, C)) → s2_out_ga(plus(A, B), C)
U3_ga(X, Y, s2_out_ga(X, A)) → U4_ga(X, Y, A, s2_in_ga(Y))
U4_ga(X, Y, A, s2_out_ga(Y, B)) → U5_ga(X, Y, s2_in_ga(plus(A, B)))
U5_ga(X, Y, s2_out_ga(plus(A, B), Z)) → s2_out_ga(plus(X, Y), Z)
U2_ga(A, B, s2_out_ga(plus(B, A), C)) → s2_out_ga(plus(A, B), C)
U1_ga(A, B, C, s2_out_ga(plus(plus(A, B), C), D)) → s2_out_ga(plus(A, plus(B, C)), D)

The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0, x1)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U8_ga(x0, x1, x2)
U3_ga(x0, x1, x2)
U4_ga(x0, x1, x2, x3)
U5_ga(x0, x1, x2)
U2_ga(x0, x1, x2)
U1_ga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ DependencyGraphProof
                          ↳ QDP
                            ↳ UsableRulesProof
QDP
                                ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))

R is empty.
The set Q consists of the following terms:

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0, x1)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U8_ga(x0, x1, x2)
U3_ga(x0, x1, x2)
U4_ga(x0, x1, x2, x3)
U5_ga(x0, x1, x2)
U2_ga(x0, x1, x2)
U1_ga(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

s2_in_ga(x0)
isNat_in_g(x0)
U9_g(x0, x1)
U6_ga(x0, x1, x2)
U7_ga(x0, x1, x2)
add_in_gga(x0, x1)
U10_gga(x0, x1, x2)
U8_ga(x0, x1, x2)
U3_ga(x0, x1, x2)
U4_ga(x0, x1, x2, x3)
U5_ga(x0, x1, x2)
U2_ga(x0, x1, x2)
U1_ga(x0, x1, x2, x3)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ DependencyGraphProof
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
QDP
                                    ↳ NonTerminationProof

Q DP problem:
The TRS P consists of the following rules:

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

S2_IN_GA(plus(A, B)) → S2_IN_GA(plus(B, A))
S2_IN_GA(plus(A, plus(B, C))) → S2_IN_GA(plus(plus(A, B), C))

The TRS R consists of the following rules:none


s = S2_IN_GA(plus(A, B)) evaluates to t =S2_IN_GA(plus(B, A))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from S2_IN_GA(plus(A, B)) to S2_IN_GA(plus(B, A)).